/* 预留给admin自定义样式 */

/* 后台管理样式 */

/* 整体布局 */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航 */
.admin-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.04);
}

.admin-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
}

/* 主体内容区域 */
.admin-main {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 80px);
}

/* 左侧导航栏 */
.admin-sidebar {
  width: 240px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  padding: 20px 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #6c757d;
  text-decoration: none;
  border-radius: 0 8px 8px 0;
  margin-right: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: #e9ecef;
  color: #495057;
}

.nav-item.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-icon {
  font-size: 18px;
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.nav-text {
  font-weight: 500;
  font-size: 14px;
}

/* 右侧内容区域 */
.admin-content {
  flex: 1;
  padding: 24px;
  background: #fff;
  overflow-y: auto;
}

.content-page {
  display: none;
}

.content-page.active {
  display: block;
}

.content-page h3 {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 12px;
}

/* 内容网格 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.content-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: all 0.2s ease;
}

.content-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.content-card h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.content-card p {
  margin: 0 0 16px 0;
  color: #6c757d;
  line-height: 1.5;
}

/* 卡片操作按钮 */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions .btn {
  flex: 1;
  min-width: 100px;
}

/* 数据统计面板 */
.stats-panel {
  margin-top: 24px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
}

.stats-panel h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

/* 按钮样式 */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #ced4da;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8, #6a4190);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
  border-color: transparent;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* 导入进度面板 */
.import-progress {
  margin-top: 24px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
}

.import-progress h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.progress-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.progress-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.progress-value {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

  .failed-file-error {
    font-size: 14px;
    color: #6c757d;
    font-family: monospace;
  }

.result-actions {
  margin-top: 16px;
  text-align: center;
}

.result-actions .btn {
  min-width: 100px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .admin-main {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }
  
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 16px;
  }
  
  .nav-item {
    flex-shrink: 0;
    margin-right: 8px;
    border-radius: 8px;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .progress-info {
    grid-template-columns: 1fr;
  }
}

/* 策略管理菜单 */
.strategy-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.strategy-menu-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.strategy-menu-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.menu-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border-radius: 8px;
}

.menu-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.menu-desc {
  font-size: 14px;
  color: #6c757d;
  line-height: 1.4;
}

/* 欢迎页面样式 */
.welcome-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.welcome-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.welcome-card h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.welcome-card p {
  margin: 0 0 20px 0;
  color: #6c757d;
  line-height: 1.5;
}

.quick-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-nav .btn {
  width: 100%;
  justify-content: center;
}

.system-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-stats .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.system-stats .stat-item:last-child {
  border-bottom: none;
}

.system-stats .stat-label {
  font-size: 14px;
  color: #6c757d;
}

.system-stats .stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

/* 策略统计 */
.strategy-stats {
  margin-top: 24px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
}

.strategy-stats h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.strategy-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.strategy-stats .stat-item {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.strategy-stats .stat-label {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
}

.strategy-stats .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

/* 二级子导航 */
.subnav {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 16px;
}

.subnav-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: #495057;
  text-decoration: none;
  transition: all .2s ease;
}

.subnav-item:hover {
  background: #f8f9fa;
  color: #2c3e50;
}

.subnav-item.active {
  color: #2c3e50;
  border-color: #e9ecef;
  border-bottom-color: #667eea;
  background: #fff;
}

/* TAB导航样式 */
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  border: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  color: #6c757d;
  cursor: pointer;
  transition: all .2s ease;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.tab-btn.active {
  background: #fff;
  color: #2c3e50;
  border-color: #e9ecef;
  border-bottom-color: #667eea;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

/* TAB内容样式 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.95em;
  transition: all 0.3s ease;
  background: white;
  color: #495057;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
  margin-top: 6px;
  font-size: 0.85em;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-help i {
  color: #667eea;
}

/* 复选框样式 */
.cache-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95em;
  color: #495057;
}

.cache-checkbox input[type="checkbox"] {
  margin: 0;
  transform: scale(1.1);
}

.checkmark {
  margin-left: 4px;
}

/* 策略列表样式 */
.strategy-list {
  max-height: 40vh;
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px;
  background: #f8f9fa;
}

.strategy-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  padding: 4px 8px;
}

.strategy-list label:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  justify-content: center;
}

/* 完整的响应式设计 */
@media (max-width: 768px) {
  .admin-main {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }
  
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 16px;
  }
  
  .nav-item {
    flex-shrink: 0;
    margin-right: 8px;
    border-radius: 8px;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .progress-info {
    grid-template-columns: 1fr;
  }
  
  .strategy-menu-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .menu-header {
    width: 100%;
  }
  
  .menu-actions {
    width: 100%;
  }
  
  .menu-actions .btn {
    width: 100%;
  }
  
  .welcome-content {
    grid-template-columns: 1fr;
  }
  
  .strategy-stats .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* 执行记录全屏表格布局 */
.full-width-table {
  display: flex;
  flex-direction: column;
}

.full-width-table .table-container {
  flex: 1;
}

.full-height-table {
  height: calc(100vh - 260px);
  min-height: 420px;
  overflow: auto;
}

.full-width-table .results-table {
  width: 100%;
  table-layout: fixed;
}

.full-width-table .results-table th,
.full-width-table .results-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 导航组样式 */
.nav-group {
  margin-bottom: 8px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  color: #495057;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e9ecef;
  border-radius: 0 8px 8px 0;
  margin-right: 12px;
  margin-bottom: 4px;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 20px;
}

.nav-sub-item {
  padding: 8px 20px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e9ecef;
  margin-right: 12px;
}

.nav-sub-item:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.nav-sub-item.active {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  border-color: #28a745;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}
